Second Order Equations: Non-homogeneous DEs

Edmund Chiang
MATH2351 / 2352 — Boyce & DiPrima §3.5
February 20, 2026

1   Main Results

1.1   Solution Structure

Theorem — Difference of Solutions

Let $Y_1$ and $Y_2$ be solutions of

$$L(y) = y'' + p(t)y' + q(t)y = g(t),$$

where $p(t)$, $q(t)$, $g(t)$ are continuous on $I = (\alpha, \beta)$. Then $Y_1 - Y_2$ is a solution to

$$L(y) = y'' + p(t)y' + q(t)y = 0.$$

That is, if $\{y_1, y_2\}$ is a fundamental set of solutions to the homogeneous $L(y) = 0$, then

$$Y_1(t) - Y_2(t) = c_1 y_1(t) + c_2 y_2(t)$$

for some constants $c_1$, $c_2$.

Theorem — General Solution Structure

The general solution of

$$L(y) = y'' + p(t)y' + q(t)y = g(t)$$

can be written as

$$y(t) = \phi(t) = c_1 y_1(t) + c_2 y_2(t) + Y(t),$$

where $\{y_1, y_2\}$ is a fundamental set of solutions (called complementary functions) of the corresponding homogeneous DE, and $Y(t)$ is a specific solution (called a particular integral) of the DE.

Remark
  1. Note that $L(c_1 y_1 + c_2 y_2) = 0$ for all possible choices of $c_1$, $c_2$.
  2. But $L(Y) = g(t)$.
  3. We see that the general solution to the above non-homogeneous DE $$y(t) = \phi(t) = c_1 y_1(t) + c_2 y_2(t) + Y(t),$$ is far from unique because of different choices of $c_1$, $c_2$.

2   Method of Undetermined Coefficients

2.1   Exponential Right-Hand Side

Example (B&D). Solve

$$y'' - 3y' - 4y = 3e^{2t}. \tag{1}$$

We divide the process into two parts:

Part I: homogeneous equation. We solve

$$y'' - 3y' - 4y = 0.$$

This gives the characteristic equation

$$r^2 - 3r - 4 = (r + 1)(r - 4) = 0$$

so that complementary functions are $\{e^{-t}, e^{4t}\}$.

Part II:

Since $g(t) = 3e^{2t}$ and it satisfies (1), so it is reasonable to try $Y(t) = Ae^{2t}$. Notice that

$$Y' = 2Ae^{2t}, \quad Y'' = 4Ae^{2t},$$

and substitute them into the (1) yields

$$(4A - 3(2A) - 4A)e^{2t} = 3e^{2t}.$$

Thus we must require

$$-6A = 3,$$

or $A = -1/2$. Thus the particular integral is $Y(t) = -\frac{1}{2}e^{2t}$. We deduce that the general solution is given by

$$y(t) = c_1 e^{-t} + c_2 e^{4t} - \frac{1}{2}e^{2t}.$$

A simple check by substituting this $y$ into the DE (1) easily verifies that our finding is correct.


2.2   Trigonometric Right-Hand Side

Example (B&D). Solve

$$y'' - 3y' - 4y = 2\sin t. \tag{2}$$

The complementary functions are the same as before: $\{e^{-t}, e^{4t}\}$.

Part IIa: Since $g(t) = 2\sin t$, let us first substitute $Y(t) = A\sin t$ into the (2) and this yields

$$(-A\sin t) - 3(A\cos t) - 4(A\sin t) = 2\sin t.$$

That is,

$$(2 + 5A)\sin t + 3A\cos t = 0,$$

which is impossible (since $\cos t$ and $\sin t$ are linearly independent) unless both $3A = 0$ and $2 + 5A = 0$. The first equation gives $A = 0$. But then the second equation is impossible. This is a contradiction. Hence the choice of $Y(t) = A\sin t$ is incorrect.

Part IIb: Let us try $Y(t) = A\sin t + B\cos t$. Then

\begin{align} Y' &= A\cos t - B\sin t \\ Y'' &= -A\sin t - B\cos t. \end{align}

Substitute them into the DE (2) yields

$$(-A + 3B - 4A)\sin t + (-B - 3A - 4B)\cos t = 2\sin t.$$

That is,

\begin{align} -5A + 3B &= 2; \\ -3A - 5B &= 0. \end{align}

Thus, $A = -5/17$ and $B = 3/17$. So the general solution to the DE (2) is given by

$$y(t) = c_1 e^{-t} + c_2 e^{4t} - \frac{5}{17}\sin t + \frac{3}{17}\cos t.$$

2.3   Mixed Exponential-Trigonometric Terms

Example (B&D). Solve

$$y'' - 3y' - 4y = -8e^t\cos 2t. \tag{3}$$

We note that the complementary functions are the same as in the earlier examples. We also learnt from the last example that we should allow both $\sin$ and $\cos$ whenever the non-homogeneous $g$ has the same. So let us try

$$Y(t) = Ae^t\cos t + Be^t\sin t.$$

We have

$$Y'(t) = (A + 2B)e^t\cos 2t + (-2A + B)e^t\sin 2t.$$

We also have

$$Y''(t) = (-3A + 4B)e^t\cos 2t + (-4A - 3B)e^t\sin 2t.$$

Substitute them into the DE (3) yields

$$10A + 2B = 8, \quad 2A - 10B = 0.$$

Hence $A = 10/13$ and $B = 2/13$. Thus, the particular integral is given by

$$Y(t) = \frac{10}{13}e^t\cos 2t + \frac{2}{13}e^t\sin 2t.$$

Thus the general solution is given by

$$y(t) = c_1 e^{-t} + c_2 e^{4t} + Y(t).$$

3   Superposition for Multiple $g(t)$

Example (B&D) "Multiple" $g$. Solve

$$y'' - 3y' - 4y = 3e^{2t} + 2\sin t - 8e^t\cos 2t. \tag{4}$$

This may seem a difficult problem. But let us recall the following solved DEs:

\begin{align} y'' - 3y' - 4y &= 3e^{2t}, & Y_1(t) &= -\tfrac{1}{2}e^{2t}; \\ y'' - 3y' - 4y &= 2\sin t, & Y_2(t) &= -\tfrac{5}{17}\sin t + \tfrac{3}{17}\cos t; \\ y'' - 3y' - 4y &= -8e^t\cos 2t, & Y_3(t) &= \tfrac{10}{13}e^t\cos 2t + \tfrac{2}{13}e^t\sin 2t. \end{align}

We claim that the general solution is given by

\begin{align} y(t) &= c_1 e^{-t} + c_2 e^{4t} + Y_1(t) + Y_2(t) + Y_3(t) \\[6pt] &= c_1 e^{-t} + c_2 e^{4t} - \frac{1}{2}e^{2t} - \frac{5}{17}\sin t + \frac{3}{17}\cos t + \frac{10}{13}e^t\cos 2t + \frac{2}{13}e^t\sin 2t \end{align}
Theorem — Superposition for Non-homogeneous Terms

Suppose $g(t) = \sum_{k=1}^n g_k(t)$. If we have solved

$$L(y) = y'' + p(t)y' + q(t)y = g_k(t), \quad L(Y_k(t)) = g_k(t)$$

for each $k = 1, \ldots, n$, then

$$L(Y_1 + \cdots + Y_n) = L(Y_1) + \cdots + L(Y_n) = g_1 + \cdots + g_n,$$

as required.


4   Exercises

Exercise — Undetermined Coefficients

Use the method of undetermined coefficients to find the general solution:

  1. $y'' - 2y' - 3y = 3e^{2t}$ $c_1 e^{3t} + c_2 e^{-t} - e^{2t}$
  2. $y'' + 2y' + 5y = 4e^{-t}\cos 2t$ $e^{-t}(c_1\cos 2t + c_2\sin 2t) + te^{-t}\sin 2t$
  3. $y'' - 2y' - 3y = -3te^{-t}$ $c_1 e^{3t} + c_2 e^{-t} + \frac{3}{4}te^{-t} + \frac{3}{16}e^{-t}$

5   Practice MCQ

Practice: Method of Undetermined Coefficients

Find a particular solution to:

$$y'' - 3y' - 4y = 3e^{2t}$$
PHASE 0 Choose the Trial Solution

The RHS is $3e^{2t}$. What form should we try for the particular solution $Y(t)$?

Good! Now substitute and solve for $A$...
PHASE A Build the Strategy

With $Y = Ae^{2t}$, what are $Y'$ and $Y''$?

Substitute into $Y'' - 3Y' - 4Y = 3e^{2t}$:

Now solve for $A$...
PHASE B Solve for Coefficient
Step B1

From $-6Ae^{2t} = 3e^{2t}$, solve for $A$:

Step B2

The particular solution is:

Excellent! The particular solution is $Y(t) = -\frac{1}{2}e^{2t}$.